﻿<!DOCTYPE html>
<html>
<head>
    <title>Lava: Test Page</title>
    <script src="../scripts/lava.js"></script>
    <script type="text/html" id="template">
        <tr>
            <td><span data-template="{text: [i].name}"></span></td>
        </tr>
    </script>
    <script>
        var Item = Lava.Object({ name: '' });

        var Controller = Lava.Controller({
            items: []
        });
        
        Controller.items.fill(Lava.Array([{name: 'item 1'}, {name: 'item 2'}, {name: 'item 3'}], Item));
    </script>
</head>
<body>
    <table>
        <tbody data-bind="{foreach: {bind: Controller.items, template: 'template'}}"></tbody>
    </table>
</body>
</html>